package com.bhs.sansong.adapter;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansong.R;
import com.bhs.sansong.bean.CircleFriendsBean;
import com.bhs.sansong.ui.message.CirclePersonageActivity;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class PraiseAdapter extends BaseQuickAdapter<CircleFriendsBean.AgreeListDTO, BaseViewHolder> {

    public PraiseAdapter(@Nullable List<CircleFriendsBean.AgreeListDTO> data) {
        super(R.layout.item_praise, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, CircleFriendsBean.AgreeListDTO item) {
        ImageView ivHead = helper.getView(R.id.iv_head);
        Glide.with(mContext).load(item.getHeaderpic()).into(ivHead);
        ivHead.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mContext.startActivity(new Intent(mContext, CirclePersonageActivity.class)
                        .putExtra("uid", item.getUnid())
                        .putExtra("logistics_id", item.getLogistics_id()));            }
        });

    }
}
